#include <iostream>
#include <vector>
using namespace std;

/*"abc" 是一个字母序连续字符串，而 "acb" 和 "za" 不是。*/

int longestContinuousSubstring(string s)
{
    int len = s.size();
    int cnt = 1, ans = 1;
    for (int i = 1; i < len; i++)
    {
        if (s[i] == s[i - 1] + 1)
        {
            ++cnt;
        }
        else
        {
            cnt = 1;
        }
        ans = max(ans, cnt);
    }
    return ans;
}


int main()
{
    string s = "abacaba";
    cout<<longestContinuousSubstring(s)<<endl;
    return 0;
}